home *** CD-ROM | disk | FTP | other *** search
/ 64'er Special 56 / 64er_Magazin_Sonderheft_56_19xx_Markt__Technik_de_Side_A.d64 / strom v2.1 (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  11KB  |  546 lines

  1. 1000 rem ******************************
  2. 1010 rem *    programm stromkosten    *
  3. 1020 rem *         v 2.1              *
  4. 1030 rem *    u. schwebinghaus        *
  5. 1040 rem *    erbschloer str. 115     *
  6. 1050 rem *    5600 wuppertal 21       *
  7. 1060 rem *                            *
  8. 1070 rem ******************************
  9. 1080 :
  10. 1085 :
  11. 1086 :
  12. 1087 :
  13. 1100 rem ******* vorbereitung *********
  14. 1110 :
  15. 1120 dim vt(12),vn(12)
  16. 1130 :
  17. 1225 :
  18. 1226 :
  19. 1240 cd$=""
  20. 1245 tt$="s t r o m - r e c h n u n g"
  21. 1250 tu$="[184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184]"
  22. 1255 mp$(1)="informationen       "
  23. 1260 mp$(2)="kostendaten-eingabe "
  24. 1265 mp$(3)="zaehlerdaten-eingabe"
  25. 1270 mp$(4)="datums-eingabe      "
  26. 1275 mp$(5)="uebersicht der daten"
  27. 1280 mp$(6)="abrechnung          "
  28. 1285 mp$(7)="speichern der daten "
  29. 1290 mp$(8)="laden von daten     "
  30. 1295 mp$(9)="programm-ende       "
  31. 1300 poke 53280,15:poke 53281,15
  32. 1305 print"[147]"tab(5)tt$:print tab(5)tu$
  33. 1310 print:print
  34. 1315 for i=1 to 9:print"[158]"tab(5) mp$(i):print:next i
  35. 1320 print"[144]wahl mit cursor up und down und return";
  36. 1325 if r=0 then r=1
  37. 1327 gosub1365
  38. 1330 get a$:if a$="" then1330
  39. 1335 if a$="" then gosub1385
  40. 1340 if a$="[145]" then gosub1400
  41. 1345 if a$<>chr$(13) then1330
  42. 1350 if r=9 then print"[147]":end
  43. 1355 on r gosub 7000,1540,2000,4130,8000,2300,5000,6000:goto 1305
  44. 1360 :
  45. 1365 print""left$(cd$,(r-1)*2)tab(5)""mp$(r):return
  46. 1370 :
  47. 1375 print""left$(cd$,(r-1)*2)tab(5)"[158]"mp$(r):return
  48. 1380 :
  49. 1385 gosub1375:r=r+1:if r>9 then r=1
  50. 1390 gosub1365:return
  51. 1395 :
  52. 1400 gosub1375:r=r-1:if r<1 then r=9
  53. 1405 gosub1365:return
  54. 1410 :
  55. 1530 :
  56. 1540 rem **** kostendaten-eingabe *****
  57. 1550 :
  58. 1560 print"[147]"
  59. 1570 print"kostendaten-eingabe"
  60. 1580 print
  61. 1590 input"anzahl der kostensaetze";ak%
  62. 1595 print
  63. 1600 if ak%>12 then 1560
  64. 1605 :
  65. 1610 :         for i=1 to ak%
  66. 1615 :
  67. 1617 print"[147]kostendaten-satz"i
  68. 1620 print"preis pro kwh in pf (tag)"
  69. 1630 input pt(i)
  70. 1640 print"preis pro kwh in pf (nacht)"
  71. 1650 input pn(i)
  72. 1660 print"grundpreis pro monat in dm"
  73. 1670 input gp(i)
  74. 1680 print"ausgleichsabgabe in %"
  75. 1690 input aa(i)
  76. 1700 print"mehrwertsteuer in %"
  77. 1710 input mw(i)
  78. 1720 print"daten gueltig bis einschl.";
  79. 1730 print"     [146].  [146][157][157][157][157][157][157][157]";
  80. 1740 input gk$(i)
  81. 1741 d$=gk$(i):gosub 9000
  82. 1742 if er=1 then 1720
  83. 1743 d1$=gk$(i-1):d2$=gk$(i):gosub 9200
  84. 1744 if er=1 then 1720
  85. 1745 :
  86. 1746 print"k[146]orrektur oder w[146]eiter?"
  87. 1747 :
  88. 1750 get a$:if a$="" then 1750
  89. 1755 :
  90. 1760 if a$="k"then 1617
  91. 1770 if a$="w"then 1800
  92. 1775 :
  93. 1780 goto 1750
  94. 1790 :
  95. 1800 :         next i
  96. 1810 :
  97. 1820 :   return
  98. 1830 :
  99. 1840 :
  100. 2000 rem **** zaehlerdaten-eingabe ****
  101. 2010 :
  102. 2020 print"[147]zaehlerdaten-eingabe"
  103. 2030 :
  104. 2040 print"alte zaehlerstaende:"
  105. 2050 print"zaehler nacht in kwh"
  106. 2060 input zn(0)
  107. 2070 print"zaehler   tag in kwh"
  108. 2080 input zt(0)
  109. 2090 :
  110. 2100 print"neue zaehlerstaende:"
  111. 2110 print"zaehler nacht in kwh"
  112. 2120 input zn(1)
  113. 2130 print"zaehler   tag in kwh"
  114. 2140 input zt(1)
  115. 2145 zt=zt(1)-zt(0):zn=zn(1)-zn(0)
  116. 2146 if zt<0 then zt=zt+100000
  117. 2147 if zn<0 then zn=zn+100000
  118. 2150 :
  119. 2160 print"k[146]orrektur oder m[146]enue?"
  120. 2165 :
  121. 2170 get a$:if a$="" then 2170
  122. 2180 :
  123. 2190 if a$="k" then 2020
  124. 2200 if a$="m" then 2250
  125. 2210 :
  126. 2220 goto 2170
  127. 2230 :
  128. 2250 :          return
  129. 2260 :
  130. 2270 :
  131. 2300 rem ******** abrechnung **********
  132. 2310 :
  133. 2320 if ak%=0 then 3280
  134. 2330 if zt=0 and zn=0 then 3280
  135. 2340 if ab$="" or ae$="" then 3280
  136. 2350 :
  137. 2440 :
  138. 2445 print"[147]";
  139. 2450 printtab(8)"stromkosten-abrechnung"
  140. 2455 printtab(8)"[163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  141. 2460 print tab(5)"von "ab$;
  142. 2470 print" bis einschl. "ae$
  143. 2480 print:print
  144. 2490 k$="monat verbrauch   rohpreis"
  145. 2500 k$=k$+"  endpreis"
  146. 2510 print k$
  147. 2520 k$="[183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183]"
  148. 2530 k$=k$+"[183][183][183][183][183][183][183][183][183][183][183]"
  149. 2540 print"      tag nacht"
  150. 2550 print k$
  151. 2560 :
  152. 2570 :
  153. 2580 a=val(left$(ab$,2))
  154. 2590 e=val(left$(ae$,2))
  155. 2600 i=a:dv=0
  156. 2605 :
  157. 2610 if i=12 or i=1 then dv=dv+15
  158. 2620 if i=10 or i=11 then dv=dv+10
  159. 2630 if i=2 or i=3 then dv=dv+10
  160. 2640 if i>3 and i<10 then dv=dv+5
  161. 2645 :
  162. 2650 if i=e then 2700
  163. 2660 i=i+1
  164. 2670 if i>12 then i=i-12
  165. 2680 goto 2610
  166. 2690 :
  167. 2700 for i=1 to 12
  168. 2710 :
  169. 2720 :    vt(i)=0
  170. 2730 :    vn(i)=0
  171. 2740 :
  172. 2750 next i
  173. 2760 :
  174. 2770 :           i=a
  175. 2780 :
  176. 2790 if i=12 or i=1 then vt(i)=zt/dv*15
  177. 2800 if i=12 or i=1 then vn(i)=zn/dv*15
  178. 2810 if i=10 or i=11 then vt(i)=zt/dv*10
  179. 2820 if i=10 or i=11 then vn(i)=zn/dv*10
  180. 2825 if i=2 or i=3 then vt(i)=zt/dv*10
  181. 2827 if i=2 or i=3 then vn(i)=zn/dv*10
  182. 2830 if i>3 and i<10 then vt(i)=zt/dv*5
  183. 2840 if i>3 and i<10 then vn(i)=zn/dv*5
  184. 2850 :
  185. 2860 if i=e then 2920
  186. 2870 :
  187. 2880 :           i=i+1
  188. 2890 :           if i>12 then i=i-12
  189. 2900 goto 2790
  190. 2910 :
  191. 2920 rem eigentliche abrechnung
  192. 2930 :
  193. 2940 :         i=a
  194. 2945 sr=0:se=0
  195. 2947 :         ja=val(right$(ab$,2))
  196. 2950 ma=i
  197. 2960 if ma>12 then ma=ma-12:ja=ja+1
  198. 2990 gosub 9400:rem kosatz
  199. 3000 if er=1 then 3280
  200. 3010 :
  201. 3030 rp=vt(ma)*pt(ks)+vn(ma)*pn(ks)
  202. 3040 rp=rp/100+gp(ks)
  203. 3045 sr=sr+rp
  204. 3060 ep=rp+aa(ks)*rp/100
  205. 3070 ep=ep+mw(ks)*ep/100
  206. 3075 se=se+ep
  207. 3080 :
  208. 3085 :  gosub 9640
  209. 3087 :
  210. 3090 :
  211. 3100 :         if ma=e then 3140
  212. 3110 :         i=i+1
  213. 3120 :         goto 2947
  214. 3130 :
  215. 3140 rem schlusszeilen drucken
  216. 3150 :
  217. 3160 print k$
  218. 3170 pr$=str$(zt)
  219. 3180 print tab(4+6-len(pr$)) pr$;
  220. 3190 pr$=str$(zn)
  221. 3195 print tab(10+6-len(pr$)) pr$;
  222. 3197 pr$=str$(int(sr*100)/100)
  223. 3200 :
  224. 3202 :   gosub 9800
  225. 3204 :
  226. 3206 print tab(18+7-len(pr$)) pr$;
  227. 3207 pr$=str$(int(se*100)/100)
  228. 3208 :
  229. 3209 :   gosub 9800
  230. 3210 :
  231. 3211 print tab(28+7-len(pr$)) pr$
  232. 3212 print tab(28)"=======":print
  233. 3215 :
  234. 3220 :   gosub 9900
  235. 3250 :
  236. 3280 :              return
  237. 3290 :
  238. 3300 :
  239. 4130 rem ***** abrechnungszeitraum ****
  240. 4140 :
  241. 4150 print"[147]abrechnungszeitraum":print
  242. 4160 print"von monat.jahr (mm.jj)  ";
  243. 4170 print"   [146].  [146][157][157][157][157][157][157][157]";
  244. 4180 inputab$:rem * abrechnungsbeginn *
  245. 4182 d$=ab$:gosub 9000
  246. 4185 if er=1 then 4130
  247. 4190 print"bis einschl.   (mm.jj)  ";
  248. 4200 print"   [146].  [146][157][157][157][157][157][157][157]";
  249. 4210 inputae$:rem ** abrechnungsende **
  250. 4211 :
  251. 4212 d$=ae$:gosub 9000
  252. 4214 if er=1 then 4130
  253. 4215 d1$=ab$:d2$=ae$:gosub 9200
  254. 4224 if er=1 then 4130
  255. 4230 :
  256. 4240 :          return
  257. 4250 :
  258. 4260 :
  259. 5000 rem ***** datenspeicherung *******
  260. 5010 :
  261. 5020 if ak%=0 and zt=0 and zn=0 and ab$="" and ae$="" then 5190
  262. 5040 :
  263. 5045 print"[147]datenspeicherung"
  264. 5046 print"daten werden abgelegt"
  265. 5047 :
  266. 5049 open 2,8,15,"s:strom-daten"
  267. 5050 close 2
  268. 5052 open 1,8,4,"strom-daten,s,w"
  269. 5060 :
  270. 5070 print#1,ab$:  print#1,ae$
  271. 5075 print#1,zt(0):print#1,zt(1)
  272. 5077 print#1,zn(0):print#1,zn(1)
  273. 5080 print#1,zt:print#1,zn
  274. 5085 print#1,ak%
  275. 5090 :
  276. 5100 :         for i=1 to ak%
  277. 5110 :
  278. 5120 print#1,pt(i):print#1,pn(i)
  279. 5125 print#1,gp(i):print#1,aa(i)
  280. 5130 print#1,mw(i):print#1,gk$(i)
  281. 5140 :
  282. 5150 :         next i
  283. 5160 :
  284. 5170 close 1
  285. 5180 :
  286. 5190 :         return
  287. 5200 :
  288. 5210 :
  289. 6000 rem ****** stromdaten laden ******
  290. 6010 :
  291. 6012 print"[147]stromdaten laden"
  292. 6013 print"daten werden eingelesen"
  293. 6015 :
  294. 6020 open 1,8,4,"strom-daten,s,r"
  295. 6030 :
  296. 6040 input#1,ab$:input#1,ae$
  297. 6045 input#1,zt(0):input#1,zt(1)
  298. 6047 input#1,zn(0):input#1,zn(1)
  299. 6050 input#1,zt:input#1,zn
  300. 6060 input#1,ak%
  301. 6070 :
  302. 6080 :         for i=1 to ak%
  303. 6090 :
  304. 6100 input#1,pt(i):input#1,pn(i)
  305. 6102 input#1,gp(i):input#1,aa(i)
  306. 6110 input#1,mw(i):input#1,gk$(i)
  307. 6120 :
  308. 6130 :         next i
  309. 6140 :
  310. 6150 close 1
  311. 6160 :         return
  312. 6170 :
  313. 6180 :
  314. 7000 rem ******* informationen ********
  315. 7010 :
  316. 7015 print"[147]"tab(6);
  317. 7020 print"i n f o r m a t i o n e n"
  318. 7030 printtab(6)"zum pgm stromkosten"
  319. 7035 print
  320. 7040 print" dieses pgm soll ihre stromrechnung"
  321. 7060 print" kontrollierbar und verstaendlicher"
  322. 7080 print" machen.":print
  323. 7085 print" dateneingaben":print
  324. 7090 print" geben sie zuerst die zaehlerdaten"
  325. 7100 print" ihrer stromzaehler ein."
  326. 7110 print" (anwahl mit cursor down, danach <ret>)"
  327. 7120 print
  328. 7130 print" haben sie nur einen tarif, geben sie"
  329. 7140 print" fuer zaehler nacht immer 0 ein."
  330. 7150 print
  331. 7160 print" dann werden die kostendaten eingegeben"
  332. 7180 print" unter grundpreis wird hier auch "
  333. 7200 print" bereitstellungs- und verrechnungspreis"
  334. 7220 print" mit einbezogen.":print
  335. 7230 print" schliesslich wird noch der"
  336. 7250 print" abrechnungszeitraum eingegeben"
  337. 7260 :
  338. 7270 :   print:gosub 9900
  339. 7280 :
  340. 7290 print"[147] i n f o   stromdaten"
  341. 7291 print" der maximale abrechnungszeitraum"
  342. 7293 print" betraegt 12 monate."
  343. 7295 print" speichern und laden"
  344. 7300 print:print" weiterhin koennen sie eine"
  345. 7320 print" abrechnung speichern, wenn alle daten"
  346. 7340 print" angegeben wurden."
  347. 7350 print" diese datei koennen sie auch wieder"
  348. 7360 print" von diskette laden."
  349. 7370 print" bei neuspeicherung wird die zuvor"
  350. 7390 print" gespeicherte abrechnung geloescht."
  351. 7410 print" berechnungsgrundlagen"
  352. 7420 print" da nur noch einmal pro jahr abgelesen"
  353. 7440 print" wird, muss man die zwischenstaende bei"
  354. 7460 print" tarifaenderungen schaetzen."
  355. 7470 :
  356. 7480 :      print:gosub 9900
  357. 7490 :
  358. 7500 print"[147] i n f o   stromdaten"
  359. 7510 print" dazu wird hier der verbrauch auf die"
  360. 7530 print" monate der abrechnung verteilt unter"
  361. 7550 print" beachtung des hoeheren verbrauchs"
  362. 7570 print" in den winter- und uebergangsmonaten."
  363. 7590 print" beim errechnen der monatsendpreise"
  364. 7610 print" wird nach addition der ausgleichs-"
  365. 7620 print" abgabe die mehrwertsteuer zuge-"
  366. 7640 print" schlagen."
  367. 7650 print" bei groesseren unstimmigkeiten"
  368. 7670 print" sprechen sie am besten mit ihren"
  369. 7690 print" stadtwerken!"
  370. 7700 :
  371. 7710 :     print:gosub 9900
  372. 7720 :
  373. 7730 :     return
  374. 7740 :
  375. 7750 :
  376. 7900 end
  377. 8000 rem ****** daten-ausgabe  ********
  378. 8010 :
  379. 8020 print"[147]"tab(10)"daten-ausgabe"
  380. 8030 print:print
  381. 8035 :
  382. 8037 z=0
  383. 8040 if ak%=0 then z=z+1
  384. 8050 if zt=0 and zn=0 then z=z+1
  385. 8060 if ab$="" or ae$="" then z=z+1
  386. 8065 if z=3 then 8400
  387. 8070 :
  388. 8080 print"abrechnungsbeginn  ";
  389. 8090 if ab$="" then print "?":goto 8110
  390. 8100 print ab$
  391. 8110 print:print"abrechnungsende    ";
  392. 8120 if ae$="" then print "?":goto 8140
  393. 8130 print ae$
  394. 8140 print:print
  395. 8150 print"zaehler tag   (alt)"zt(0)
  396. 8155 print
  397. 8160 print"zaehler tag   (neu)"zt(1)
  398. 8165 print
  399. 8170 print"zaehler nacht (alt)"zn(0)
  400. 8175 print
  401. 8180 print"zaehler nacht (neu)"zn(1)
  402. 8185 print
  403. 8190 print
  404. 8200 :
  405. 8210 :     print:gosub 9900
  406. 8220 :
  407. 8230 print"[147]"tab(10)"daten-ausgabe"
  408. 8240 print""tab(10)"kostensaetze"
  409. 8250 print:print
  410. 8260 if ak%=0 then 8400
  411. 8265 :
  412. 8270 :       for i=1 to ak%
  413. 8274 print"[147]"tab(10)"daten-ausgabe"
  414. 8275 print""tab(10)"kostensaetze"
  415. 8277 print:print
  416. 8280 print"preis p. kwh   tag"pt(i)" pf"
  417. 8285 print
  418. 8290 print"preis p. kwh nacht"pn(i)" pf"
  419. 8295 print
  420. 8300 print"grundpreis p.monat"gp(i)" dm"
  421. 8305 print
  422. 8310 print"ausgleichsabgabe  "aa(i)"[160]%"
  423. 8315 print
  424. 8320 print"mehrwertsteuer    "mw(i)" %"
  425. 8325 print
  426. 8330 print"gueltig bis monat  "gk$(i)
  427. 8335 print
  428. 8340 :
  429. 8350 :    print:gosub 9900
  430. 8360 :
  431. 8370 :       next i
  432. 8380 :
  433. 8390 goto 8500
  434. 8395 :
  435. 8400 print:print
  436. 8410 print"es wurden noch keine daten";
  437. 8420 print" eingegeben!"
  438. 8430 :
  439. 8440 :     print:gosub 9900
  440. 8450 :
  441. 8500 :         return
  442. 8510 :
  443. 8520 :
  444. 9000 rem ***** subroutine datplau *****
  445. 9010 :
  446. 9020 if len(d$)<>5 then 9100
  447. 9030 if mid$(d$,3,1)<>"." then 9100
  448. 9040 if val(left$(d$,2))<1 then 9100
  449. 9050 if val(left$(d$,2))>12 then 9100
  450. 9060 if val(right$(d$,2))<60 then 9100
  451. 9070 :
  452. 9080 er=0:goto 9120
  453. 9100 er=1
  454. 9110 :
  455. 9120 :      return
  456. 9130 :
  457. 9140 :
  458. 9200 rem ***** subroutine datklei *****
  459. 9210 :
  460. 9220 j1=val(right$(d1$,2))
  461. 9230 j2=val(right$(d2$,2))
  462. 9240 m1=val(left$(d1$,2))
  463. 9250 m2=val(left$(d2$,2))
  464. 9260 :
  465. 9265 if j1=0 then 9300
  466. 9270 if j2<j1 then 9310
  467. 9275 if j2-j1>1 then 9310
  468. 9277 if j1<j2 and m1<=m2 then 9310
  469. 9280 if m2<m1 and j1=j2 then 9310
  470. 9290 :
  471. 9300 er=0:goto 9330
  472. 9310 er=1
  473. 9320 :
  474. 9330 :       return
  475. 9340 :
  476. 9350 :
  477. 9400 rem ***** subroutine kosatz ******
  478. 9410 :
  479. 9420 ii=1
  480. 9430 :
  481. 9440 mk=val(left$(gk$(ii),2))
  482. 9450 jk=val(right$(gk$(ii),2))
  483. 9460 :
  484. 9470 if ja=jk and ma<=mk then 9570
  485. 9475 if ja<jk then 9570
  486. 9480 if ii=ak% then 9530
  487. 9490 :
  488. 9500 ii=ii+1
  489. 9510 goto 9440
  490. 9520 :
  491. 9530 print"[147]kostensaetze unpassend "
  492. 9540 print"zu abrechnungszeitraum!"
  493. 9545 :
  494. 9550 :     print:gosub 9900:goto 9590
  495. 9560 :
  496. 9570 ks=ii
  497. 9580 er=0:goto 9600
  498. 9590 er=1
  499. 9600 :
  500. 9610 :         return
  501. 9620 :
  502. 9630 :
  503. 9640 rem ***** subroutine ausdruck ****
  504. 9650 :
  505. 9660 if ma<10 then print " "ma;
  506. 9670 if ma>9 then print ma;
  507. 9680 pr$=str$(int(vt(ma)))
  508. 9690 print tab(4+6-len(pr$)) pr$;
  509. 9700 pr$=str$(int(vn(ma)))
  510. 9710 print tab(10+6-len(pr$)) pr$;
  511. 9720 pr$=str$(int(rp*100)/100)
  512. 9725 :
  513. 9727 :  gosub 9800
  514. 9728 :
  515. 9730 print tab(18+7-len(pr$)) pr$;
  516. 9740 pr$=str$(int(ep*100)/100)
  517. 9742 :
  518. 9745 :  gosub 9800
  519. 9747 :
  520. 9750 print tab(28+7-len(pr$)) pr$
  521. 9760 :
  522. 9770 :         return
  523. 9780 :
  524. 9790 :
  525. 9800 rem ** subroutine spaltendruck ***
  526. 9810 :
  527. 9820 if mid$(pr$,len(pr$)-1,1)="." then         pr$=pr$+"0"
  528. 9830 if mid$(pr$,len(pr$)-2,1)<>"." then         pr$=pr$+".00"
  529. 9840 :
  530. 9850 :      return
  531. 9860 :
  532. 9870 :
  533. 9900 rem ****** subroutine weiter *****
  534. 9910 :
  535. 9912 print tab(10)">>>>> w[146]eiter";
  536. 9915 :
  537. 9920 get a$:if a$="" then 9920
  538. 9925 :
  539. 9930 if a$<>"w" then 9920
  540. 9940 :
  541. 9950 :          return
  542. 9960 :
  543. 9970 :
  544. 9980 rem ****** programm-ende *********
  545. 9990 rem ******************************
  546.